﻿@model NewsPublish.Model.Response.ResponseModel
@{
    Layout = null;
}

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/admin/js/html5.js"></script>
    <script type="text/javascript" src="/admin/js/respond.min.js"></script>
    <script type="text/javascript" src="/admin/js/PIE_IE678.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="/admin/css/H-ui.css" />
    <link type="text/css" rel="stylesheet" href="/admin/css/H-ui.admin.css" />
    <link type="text/css" rel="stylesheet" href="/admin/font/font-awesome.min.css" />
    <!--[if IE 7]>
    <link href="/admin/font/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
    <![endif]-->
    <title>评论管理</title>
</head>
<body>
    <nav class="Hui-breadcrumb"><i class="icon-home"></i> 首页 <span class="c-gray en">&gt;</span> 新闻中心 <span class="c-gray en">&gt;</span> 评论管理 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="icon-refresh"></i></a></nav>
    <div class="pd-20">

        <table class="table table-border table-bordered table-hover table-bg table-sort">
            <thead>
                <tr class="text-c">
                    <th width="80">ID</th>
                    <th width="400">新闻标题</th>
                    <th>评论内容</th>
                    <th width="130">添加时间</th>
                    <th width="200">备注</th>
                    <th width="60">操作</th>
                </tr>
            </thead>
            <tbody>
                @if (Model.code == 200)
                {
                    foreach (var m in Model.data)
                    {
                        <tr class="text-c">
                            <td>@m.Id</td>
                            <td>@m.NewsName</td>
                            <td>@m.Contents</td>
                            <td>@m.AddTime</td>
                            <td>@m.Remark</td>
                            <td class="f-14"><a title="删除" href="javascript:;" onClick="del(this,@m.Id)" class="ml-5" style="text-decoration:none"><i class="icon-trash"></i></a></td>
                        </tr>
                    }

                }

            </tbody>
        </table>
        <div id="pageNav" class="pageNav"></div>
    </div>
    <script type="text/javascript" src="/admin/js/jquery.min.js"></script>
    <script type="text/javascript" src="/admin/layer/layer.min.js"></script>
    <script type="text/javascript" src="/admin/js/pagenav.cn.js"></script>
    <script type="text/javascript" src="/admin/js/H-ui.js"></script>
    <script type="text/javascript" src="/admin/plugin/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="/admin/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="/admin/js/H-ui.admin.js"></script>
    <script>
        function del(obj, id) {
            layer.confirm('确认要删除吗？', function (index) {
                //$(obj).parents("tr").remove();
                //layer.msg('已删除!', 1);
                $.ajax({
                    type: 'post',
                    async: true,
                    url: '/Admin/Comment/DelComment',
                    data: { id: id },
                    success: function (result) {
                        if (result.code == 200) {
                           // layer.msg('已删除!', 1);
                            reload();
                        } else {
                            layer.msg(result.result, 1);
                        }
                    }

                });
            });
        }
        function reload() {
            location.replace(location.href);
        }
    </script>
</body>
</html>